package com.itheima.mybatis.service;

import com.itheima.mybatis.bean.Student;
import com.itheima.mybatis.mapper.StudentMapperImpl;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentMapperImpl mapper = new StudentMapperImpl();

    @Override
    public List<Student> findAll() {
        List<Student> list = mapper.findAll();
        return list;
    }

    @Override
    public Student findById(Integer id) {
        return mapper.findById(id);
    }

    @Override
    public int insert(Student stu) {
        return mapper.insert(stu);
    }

    @Override
    public int delete(Integer id) {
        return mapper.delete(id);
    }

    @Override
    public int update(Student stu) {
        return mapper.update(stu);
    }
}
